package basic.com.liz.learn.design.iterator;

public class MyCollection implements Collection
{
    private String[] test = {"1", "2", "3", "4"};
    
    @Override
    public Iterator iterator()
    {
        return new MyIterator(this);
    }
    
    @Override
    public Object get(int index)
    {
        return test[index];
    }
    
    @Override
    public int size()
    {
        return test.length;
    }
    
    @Override
    public Object remove(Object o)
    {
        Object text = "";
        for (String s : test)
        {
            if (o.equals(s))
            {
                text = "删除这个内容";
            }
        }
        
        return text;
    }
}
